package com.jvm.instructions;

/**
 * InstructionDemo01..
 *
 * @author Lizhong
 * @date 2019/3/8
 */
public class InstructionDemo01 {

    /**
     * ishl
     */
    private static String[] s = new String[10];
    private final static String[] ss = new String[10];
    private int ifield = 10;
    private static int ifields = 11;
    private static double ffields = 11;
    private int ff;

    public void test01() {
        int i = 1;
        int b = i >>> 4;
        boolean b1 = i == b;
        // FCMPL
        float f1 = 1f;
        float f2 = 1f;
        boolean b2 = f1 > f2;
        // NaN
        float f3 = Float.NaN;
        boolean b3 = f1 > f3;
        // 窄处理
        double d = Double.MAX_VALUE;
        float f4 = (float) d; // D2F
        int l2i = (int) Long.MAX_VALUE; //ffff ffff
        // getField putField
        s[0] = "s";
        ss[1] = "12"; // LDC 运行时常量 压入栈
        ifield += ifields + ffields;
        try {
            int i1 = i / 5;
        } catch (Exception e) {
            e.printStackTrace();
        }

        synchronized (this){
            ifield++;
        }
    }

}
